package com.treasure.service.user.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.treasure.service.BaseService;
import com.treasure.service.dto.AppVersionCheckResult;
import com.treasure.service.third.utils.RestClient;
import com.treasure.service.user.service.AppVersionCheckService;

@Service("appVersionCheckService")
public class AppVersionCheckServiceImpl extends BaseService implements AppVersionCheckService {
    @Autowired
    private RestClient restClient;
	@Override
	public AppVersionCheckResult checkUpdate(String osName, int versionCode) {
		Map<String,Object> params = new HashMap<String,Object>();
		params.put("osName", osName);
		params.put("versionCode", versionCode);
		AppVersionCheckResult result = restClient.post(this.getGateway()+"/version/v1/checkUpdate",params,AppVersionCheckResult.class);
		return result;
	}

}
